﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace DragDropTesting
{
    public partial class Form1 : Form
    {
        Label m_TestLabel = new Label();
        public Form1()
        {
            InitializeComponent();

            m_TestLabel.Visible = false;
            this.Controls.Add(m_TestLabel);
        }

        protected override void OnDragEnter(DragEventArgs drgevent)
        {
            base.OnDragEnter(drgevent);
        }

        private void Form1_DragEnter(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop, false) == true)
            {
                e.Effect = DragDropEffects.Copy;
            }

            //m_TestLabel.BringToFront();
            //m_TestLabel.Text = "Testing...";
            //m_TestLabel.Visible = true;
        }

        private void Form1_DragDrop(object sender, DragEventArgs e)
        {
            listBox1.Items.Clear();
            string[] files = ((string[])e.Data.GetData(DataFormats.FileDrop));
            foreach (string file in files)
            {
                listBox1.Items.Add(file);
            }
        }

        int m_count = 0;
        private void Form1_DragOver(object sender, DragEventArgs e)
        {
            //m_TestLabel.Location = new Point(e.X, e.Y);
        }
    }
}
